import 'package:flutter/material.dart';
import 'package:flutter_base_plugin/flutter_base_plugin.dart';

class JdEditText extends StatefulWidget {
  final String hintText;
  final bool password;
  final ValueChanged<String>? onChanged;
  final String? initText;

  JdEditText({
     Key? key,
    this.hintText = "输入内容",
    this.initText,
    this.password = false,
    this.onChanged,
  }) : super(key: key);

  @override
  _JdEditTextState createState() => _JdEditTextState();
}

class _JdEditTextState extends State<JdEditText> {
  TextEditingController? _controller;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    _controller = TextEditingController(text: widget.initText);
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      child: TextField(
        controller: _controller,
        obscureText: widget.password,
        decoration: InputDecoration(
            hintText: widget.hintText,
            border: OutlineInputBorder(
                borderRadius: BorderRadius.circular(30),
                borderSide: BorderSide.none)),
        onChanged: widget.onChanged,
      ),
      height: 68.h,
      decoration: BoxDecoration(
          border: Border(bottom: BorderSide(width: 1, color: Colors.black12))),
    );
  }




}
